'# Copyright (c) 2008-2011 Hacker Wez
'# Source code distributed under the GNU Lesser license
'# http://bluepillredpill.codeplex.com/license
Public MustInherit Class glyphbase

    Public Const GLYPH_SPRITE_SIZE As Integer = 25

    ''' <summary>
    ''' the index of the glyph in the glyphmap
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Index() As Integer
        Get
            Return _Index
        End Get
        Set(ByVal value As Integer)
            _Index = value
        End Set
    End Property
    Private _Index As Integer

    ''' <summary>
    ''' speed of decay 
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Decay() As Integer
        Get
            Return _Decay
        End Get
        Set(ByVal value As Integer)
            _Decay = value
        End Set
    End Property
    Private _Decay As Integer

    ''' <summary>
    ''' chance of glyph changing
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Volatility() As Integer
        Get
            Return _Volatility
        End Get
        Set(ByVal value As Integer)
            _Volatility = value
        End Set
    End Property
    Private _Volatility As Integer

    Public Property X() As Integer
        Get
            Return _X
        End Get
        Set(ByVal value As Integer)
            _X = value
        End Set
    End Property
    Private _X As Integer

    Public Property Y() As Integer
        Get
            Return _Y
        End Get
        Set(ByVal value As Integer)
            _Y = value
        End Set
    End Property
    Private _Y As Integer

    Function ToDestPoint() As Drawing.Point
        Return New Drawing.Point(Me.X, Me.Y)
    End Function

    Function ToSourceRect() As Drawing.Rectangle
        Return New Drawing.Rectangle(Me.Index * GLYPH_SPRITE_SIZE, 0, GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE)
    End Function

    Function ToBlurSourceRect(Optional ByVal factor As Integer = 1) As Drawing.Rectangle
        Return New Drawing.Rectangle(Me.Index * GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE * factor, GLYPH_SPRITE_SIZE, GLYPH_SPRITE_SIZE)
    End Function

    MustOverride Function spawn_footprint() As Object



End Class
